package student.web.internal;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventThreadInit;

import cloudspace.vm.VM;

public class VMTagInit implements EventThreadInit
{

	@Override
	public boolean init(Component comp, Event event) throws Exception
	{
		VM.currentVM().registerThread();
		//This filters out any events kicked off by the internal CloudSpace UI
		if(!event.getTarget().getClass().getPackage().getName().startsWith("cloudspace.") && !comp.getId().startsWith("_CSUI"))
			VM.currentVM().log.println(event.getName() +" event has occurred on component "+event.getTarget().getId());
		return true;
	}

	@Override
	public void prepare(Component comp, Event event) throws Exception
	{
		;
	}

}
